<template>
  <div style="padding-bottom: 20px">
    <el-table :data="list" class="row-main-table" :header-cell-style="{ 'background':$store.state.app.tableBgColor,'color':'#606266' }" >
      <el-table-column prop="beforeRecharge" label="操作前余额" align="center"></el-table-column>
      <el-table-column prop="price" label="操作金额" align="center"></el-table-column>
      <el-table-column prop="afterRecharge" label="操作后余额" align="center"></el-table-column>
      <el-table-column prop="insertTimeTime" label="时间" align="center"></el-table-column>
      <el-table-column prop="dictStatusName" label="状态" align="center"></el-table-column>
    </el-table>
    <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      class="row-main-pager"
      :current-page.sync="current"
      :page-size="pageSize"
      :total="total"
      layout="total, sizes, prev, pager, next, jumper"
      background></el-pagination>
  </div>
</template>
<script>
import {banlanceList} from '@/api/getData'
export default {
  props: {
    cardId: {
      type: String,
      default: '',
    }
  },
  data() {
    return {
      list: [],
      tableLoading: false,
      current: 1,
      pageSize: 10,
      total: 0,
    }
  },
  mounted(){
    this.getList()
  },
  methods:{
    async getList(){
     this.tableLoading = true
      let returnData = await banlanceList({
        cardId: this.cardId,
        page:{
          current: this.current,
          size: this.pageSize
        }
      })
      if(returnData._result){
        this.list = returnData.data.records;
        this.total = returnData.data.total;
      }
      this.tableLoading = fasle;
    },
    handleCurrentChange(currentPage) {
      this.current = currentPage;
      this.getList()
    },
    handleSizeChange(pageSize){
      this.current = 1;
      this.pageSize = pageSize;
      this.getList()
    },
  }
}


</script>
<style scope>
</style>
